<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');

define('SITE_NAME',                   'Phiên Chợ Việt');
define('COPY_RIGHT',                  'Copyright by TDN');
define('GOOGLE_MAP_LAT',              '10.826893');
define('GOOGLE_MAP_LNG',              '106.719021');
define('DEFAULT',                     'default');
define('SHOP_DEFAULT_TEMPLATE_NAME',  'smartstore');
define('SHOP_DEFAULT_PRODUCT_BLOCK',  '35');
define('SHOP_DEFAULT_PRODUCT_UPLOAD', '70');
define('TEMPLATE_FOLDER',             'template/');
define('PAGE_TEMPLATE_DIR',           './application/views/frontend/eshopper/static-pages/');
define('DATE_FORMAT_',                'Y-m-d');
define('DATE_TIME_FORMAT',            'Y-m-d H:i:s');
define('ADVERTISE_POS_1',             'position_1');
define('ADVERTISE_POS_2',             'position_2');
define('ADVERTISE_POST_ARRAY', serialize(
    array(
        1 => 'Dọc bên trái',
        2 => 'Ngang giữa trang'
        )
    )
);
define('PAGE_POSITION_ALL',    1);
define('PAGE_POSITION_TOP',    2);
define('PAGE_POSITION_BOTTOM', 3);
define('PAGE_POSITION_OTHER',  4);
define('PAGE_POSITION_NONE',   5);
define('PAGE_POSITION_TEXT', serialize(
    array(
        'Tất cả menu', 'Menu chính', 'Menu dưới', 'Không hiển thị')
    )
);

//ROLE
define('ROLE_ADMIN',      1);
define('ROLE_MOD',        2);
define('ROLE_SHOP_OWNER', 3);
define('ROLE_ADVERTISER', 4);
define('ROLE_NAME', serialize(
    array(
        ROLE_ADMIN      => 'Admin',
        ROLE_MOD        => 'Mod',
        ROLE_SHOP_OWNER => 'Chủ gian hàng',
        ROLE_ADVERTISER => 'Người quảng cáo'
        )
    )
);
define('PERSONAL_FOLDER', serialize(
    array(
        'banner', 'personal', 'product', 'slide', 'sticky', 'temp', 'uploaded'
        )
    )
);
define('UPLOAD_STRUCT', serialize(
    array(
        ROLE_ADMIN      => array('temp', 'personal', 'sticky', 'post'),
        ROLE_MOD        => array('temp', 'personal', 'sticky', 'post'),
        ROLE_SHOP_OWNER => array('temp', 'personal', 'sticky', 'product', 'banner', 'slide'),
        ROLE_ADVERTISER => array('temp', 'personal', 'sticky')
        )
    )
);

define('CONTENT_LENGTH', 3000);

//ERROR
define('UPDATE_USER_DUPLICATE_USERNAME', 1);
define('UPDATE_USER_DUPLICATE_EMAIL',    2);
define('E_SESSION_TIMEOUT',              1000);

//FLAG
define('ON',                   1);
define('OFF',                  0);
define('STATUS_PENDING',       0);
define('STATUS_ACTIVE',        1);
define('UPDATE_FLASH',         0);
define('UPDATE_FULL',          1);
define('UPDATE_LIST_ITEM',     2);
define('UPDATE_CASE_LIST',     0);
define('UPDATE_CASE_SINGLE',   1);
define('GENDER_MALE',          1);
define('GENDER_FEMALE',        0);
define('CASE_REGISTER',        1);
define('CASE_FORGET_PASSWORD', 2);

//LIMIT
define('USER_LIMIT',        10);
define('POST_LIMIT',        10);
define('PRODUCT_LIMIT',     12);
define('PRODUCT_TOP_LIMIT', 12);
define('SALE_LIMIT',        10);
define('SHOP_LIMIT',        10);
define('ORDER_LIMIT',       10);
define('CONTACT_LIMIT',     10);
define('CONTACT_TOP_LIMIT', 3);
define('RAO_VAT_LIMIT',     20);
define('WG_RAO_VAT_LIMIT',  5);
define('ADVERTISE_LIMIT',   10);
define('PAGING_BAR_LIMIT',  3);

//DIMENSION
define('POST_THUMB_W',        300);
define('POST_THUMB_H',        168);
define('POST_THUMB_RATIO',    16/9);
define('PRODUCT_THUMB_W',     250);
define('PRODUCT_THUMB_H',     250);
define('PRODUCT_THUMB_RATIO', 1);
define('BANNER_THUMB_W',      250);
define('BANNER_THUMB_H',      250);
define('BANNER_THUMB_RATIO',  250/250);
define('SLIDE_THUMB_W',       276);
define('SLIDE_THUMB_H',       143);
define('CATEGORY_THUMB_W',    160);
define('CATEGORY_THUMB_H',    160);

//MANAGE FOLDER
define('ADMIN_FOLDER',        'ql/');
define('ADMIN_FOLDER_WSLASH', 'ql');
define('SHOP_FOLDER',         'qls/');
define('SHOP_FOLDER_WSLASH',  'qls');

//PAGE SLUG
define('URL_SLUG',               '([a-z0-9-]+)');
define('PAGING_SLUG',            'trang/([0-9-]+)');
define('INSERT_SLUG',            'them-moi');
define('UPDATE_SLUG',            'cap-nhat');
define('ACCOUNT_SLUG',           'tai-khoan');
define('ADVERTISE_SLUG',         'quang-cao');
define('CONTACT_SLUG',           'lien-he');
define('CATEGORY_SLUG',          'danh-muc');
define('LAYOUT_SLUG',            'giao-dien');
define('ORDER_SLUG',             'hoa-don');
define('SHOP_SLUG',              'gian-hang');
define('SHOP_SLUG_NEW',          'e-shop');
define('PAGE_SLUG',              'trang');
define('POST_SLUG',              'tin-tuc');
define('PRODUCT_SLUG',           'san-pham');
define('PRODUCT_PACKET_SLUG',    'goi-san-pham');
define('SALE_SLUG',              'khuyen-mai');
define('CONTACT_ADVERTISE_SLUG', 'lien-he-quang-cao');
define('RAOVAT_SLUG',            'rao-vat');
define('USER_SLUG',              'nguoi-dung');
define('HIGHLIGHT_SLUG',         'san-pham-noi-bat');
define('TOP_BUY_SLUG',           'san-pham-mua-nhieu');
define('NEW_SLUG',               'san-pham-moi');
define('RAOVAT_HIGHLIGHT_SLUG',  'noi-bat');

//FOLDER URL
define('PRODUCT_IMAGE_URL',         'product/');
define('CATEGORY_IMAGE_URL',        'category/');
define('SHOP_BANNER_IMAGE_URL',     'banner/');
define('SHOP_SLIDE_IMAGE_URL',      'slide/');
define('POST_IMAGE_URL',            'post/');
define('TEMP_FOLDER_URL',           'temp/');
define('UPLOAD_FOLDER_URL',         'uploads/');
define('RAOVAT_IMAGE_URL',          'sticky/');
define('ADVERTISE_IMAGE_URL',       'advertise/');
define('ADVERTISE_FOLDER_URL',      'advertise-draft/');

/* End of file constants.php */
/* Location: ./application/config/constants.php */